﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Q.Framework.WebControls
{
    public class TimeTextBox : QTextBox
    {
        public override TypeExpression ValueType
        {
            get
            {
                return TypeExpression.Hora;
            }
            set
            {
                value = TypeExpression.Hora;
            }
        }

        public Q.Framework.ValueObject.Time Value
        {
            get
            {
                Q.Framework.ValueObject.Time v = new ValueObject.Time();
                Q.Framework.ValueObject.Time.TryParse(Text, out v);
                return v;
            }
            set
            {
                if (value == null)
                    Text = String.Empty;
                else
                    Text = value.Format();
            }
        }
    }
}
